package com.ruoyi.easyfame.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.easyfame.mapper.DemandViewsMapper;
import com.ruoyi.easyfame.domain.DemandViews;
import com.ruoyi.easyfame.service.IDemandViewsService;

/**
 * 需求查看记录Service业务层处理
 * 
 * @author xhb
 * @date 2025-08-27
 */
@Service
public class DemandViewsServiceImpl implements IDemandViewsService 
{
    @Autowired
    private DemandViewsMapper demandViewsMapper;

    /**
     * 查询需求查看记录
     * 
     * @param id 需求查看记录主键
     * @return 需求查看记录
     */
    @Override
    public DemandViews selectDemandViewsById(Long id)
    {
        return demandViewsMapper.selectDemandViewsById(id);
    }

    /**
     * 查询需求查看记录列表
     * 
     * @param demandViews 需求查看记录
     * @return 需求查看记录
     */
    @Override
    public List<DemandViews> selectDemandViewsList(DemandViews demandViews)
    {
        return demandViewsMapper.selectDemandViewsList(demandViews);
    }

    /**
     * 新增需求查看记录
     * 
     * @param demandViews 需求查看记录
     * @return 结果
     */
    @Override
    public int insertDemandViews(DemandViews demandViews)
    {
        demandViews.setCreateTime(DateUtils.getNowDate());
        return demandViewsMapper.insertDemandViews(demandViews);
    }

    /**
     * 修改需求查看记录
     * 
     * @param demandViews 需求查看记录
     * @return 结果
     */
    @Override
    public int updateDemandViews(DemandViews demandViews)
    {
        demandViews.setUpdateTime(DateUtils.getNowDate());
        return demandViewsMapper.updateDemandViews(demandViews);
    }

    /**
     * 批量删除需求查看记录
     * 
     * @param ids 需要删除的需求查看记录主键
     * @return 结果
     */
    @Override
    public int deleteDemandViewsByIds(Long[] ids)
    {
        return demandViewsMapper.deleteDemandViewsByIds(ids);
    }

    /**
     * 删除需求查看记录信息
     * 
     * @param id 需求查看记录主键
     * @return 结果
     */
    @Override
    public int deleteDemandViewsById(Long id)
    {
        return demandViewsMapper.deleteDemandViewsById(id);
    }
}
